//
//  PKRadioDetailCell.m
//  PianKe
//
//  Created by lanou on 15/10/5.
//  Copyright (c) 2015年 李伟伟. All rights reserved.
//

#import "PKRadioDetailCell.h"
#import <UIImageView+WebCache.h>

@implementation PKRadioDetailCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        
        _coverimgView = [[UIImageView alloc] init];
        _coverimgView.frame = CGRectMake(20, 10, SCREEN_WITDTH/7, SCREEN_WITDTH/7);
        [self.contentView addSubview:_coverimgView];
        
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(SCREEN_WITDTH/7 + 25, 12, 150, 20)];
        _titleLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:_titleLabel];

        
        _musicVisitLabel = [[UILabel alloc] initWithFrame:CGRectMake(SCREEN_WITDTH/7 + 40, SCREEN_WITDTH/7 - 10, 50, 20)];
        _musicVisitLabel.font = [UIFont systemFontOfSize:12];
        _musicVisitLabel.textColor = [UIColor colorWithRed:0.075 green:0.602 blue:0.901 alpha:1.000];
        [self.contentView addSubview:_musicVisitLabel];
        
        _soundView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"声音"]];
        _soundView.frame = CGRectMake(SCREEN_WITDTH/7 + 25, SCREEN_WITDTH/7 - 10, 15, 20);
        [self.contentView addSubview:_soundView];
        
        _playView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"播放"]];
        _playView.frame = CGRectMake(SCREEN_WITDTH-40, (SCREEN_WITDTH/7 + 20)/2 - 10, 20, 20);
        [self.contentView addSubview:_playView];
        
        
    }
    return self;
}
//重写configure的set方法，给cell赋值
-(void)setConfigureModel:(PKRadioDetailModel*)configureModel
{
    _configureModel = configureModel;
    [_coverimgView sd_setImageWithURL:[NSURL URLWithString:_configureModel.coverimg]];
    _titleLabel.text = _configureModel.title;
    _musicVisitLabel.text =  _configureModel.musicVisit;
    
}

+(CGFloat)heightForCell
{
    return SCREEN_WITDTH/7 + 10 + 10;
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
